﻿using Godot;
using System;

namespace StarLine.Models
{
    public struct Star
    {
        // 角度
        public float Angle;

        public Vector2 Center;

        public float Radius;

        public Vector2[] Points;

        public Star()
        {
            Angle = 0;
            Center = new Vector2();
            Radius = 1;
            Points = new Vector2[7];
        }

        public void Recalc()
        {
            // 星星的点。
            //var count = Points.Length;
            //for (int i = 0; i < count; i++)
            //{
            //    var ratio = (1f * i) / count;
            //    var finalAngle = ratio * 360 + Angle;
            //    var finalDegree = finalAngle / 180 * Mathf.Pi;
            //    var x = Center.X + MathF.Cos(finalDegree) * Radius;
            //    var y = Center.Y + MathF.Sin(finalDegree) * Radius;
            //    Points[i] = new Vector2(x, y);
            //}

            Points[0] = new Vector2(0, 10);
            Points[1] = new Vector2(1, 9);
            Points[2] = new Vector2(2, 11);
            Points[3] = new Vector2(3, 10);
            Points[4] = new Vector2(5, 11);
            Points[5] = new Vector2(7, 10);
            Points[6] = new Vector2(8, 11);
        }

    }
}
